<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>生产工艺单</title>
<style media="print">
.menu {
	display: none;
}

</style>
<style>

</style>


<body>
	<div class="menu">
		<input type="button" value="打 印" onclick="window.print()" /><br>
		<br>
	</div>
	<div class="pageContent">
		<table width="100%" border="0">
			<tr>
				<td style="font-size: 24px; height: 40px;" align="center">生产工艺单</td>
			</tr>
			<tr>
				<td>
					<table width="100%" border="1" style="border-collapse: collapse;">
						<tr>
							<td>订单号：{$oInfo['client_ordernum']}</td>
							<td>客户名称：</td>
						</tr>
						<tr>
							<td>款号：{$oInfo['sku']}</td>
							<td>负责人：</td>
						</tr>
						<tr>
							<td>工价：</td>
							<td>联系方式：</td>
						</tr>
						<tr>
							<td>生产下单日期：{:date("Y-m-d", $oInfo['create_time'])}</td>
							<td>出货日期：{$oInfo['shipment_time'] ? date("Y-m-d", $oInfo['shipment_time']) : ''}</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<?php
						$partArr = json_decode($sInfo['ps_part'], true);
						$sizeNameArr = json_decode($sInfo['ps_size_name'], true);
						$measurementArr = json_decode($sInfo['ps_measurement'], true);
						$sizeArr = json_decode($sInfo['ps_size'], true);

						$partArr = $partArr?array_values($partArr):[];
						$sizeNameArr = $sizeNameArr?array_values($sizeNameArr):[];
						$measurementArr = $measurementArr?array_values($measurementArr):[];

						if ($sizeArr) {
							foreach ($sizeArr as $sk => $sv) {
							    if (is_array($sv)){
                                    $sizeArr[$sk] = array_values($sv);
                                }
							}
						}

					?>
					<table width="100%" border="1" style="border-collapse: collapse;margin-top:8px;">
						<tr>
							<td colspan="{:count($sizeNameArr)+2}" align="center">尺寸规格</td>
							<td align="center">备注</td>
							<td align="center">产品图片</td>
						</tr>
						<tr>
							<td>部位</td>
							<td>测量方法</td>
							{foreach $sizeNameArr as $v }
							<td height="30">{$v}</td>
							{/foreach}
							<td rowspan="{:count($partArr)+1}">{$oInfo['remark']}</td>
							<td align="center" rowspan="{:count($partArr)+1}" style="width:180px;"><img src="{$sInfo['pic']}" style="max-width:180px;max-height:180px;"></td>
						</tr>
						<?php
						$i = array_key_first($sizeNameArr);
						foreach ($partArr as $v) {?>
						<tr>
							<td>{$v}</td>
							<td>{:arrayGet($measurementArr, $i, '')}</td>

							{foreach $sizeNameArr as $sk => $sv }
							<td>{$sizeArr[$sk][$i]}</td>
							{/foreach}

						</tr>
						<?php
							$i++;
						}
						?>
						<tr>
							<td rowspan="2">裁床比例</td>
							<td>&nbsp;</td>
							<?php
							$sizeNameArr = json_decode($sInfo['ps_size_name'], true);
							foreach ($sizeNameArr as $v) {?>
							<td>{$v}</td>
							<?php }?>
							<td>包装尺寸：</td>
							<td>克重：</td>
						</tr>
						<tr>
							<td></td>
							<?php foreach ($psSizeCountArr as $v) {
								?>
							<td>{$v}</td>
							<?php }?>

							<td colspan="2">纤维成分：{$sInfo['fibre_composition']}</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<table width="100%" border="1" style="border-collapse: collapse; margin-top:8px;">
						<tr>
							<td colspan="5" align="center">物料信息</td>
						</tr>
						<tr>
							<td>类别</td>
							<td>物料名称/编号</td>
							<td>颜色/色号</td>
							<td width="80">&nbsp;</td>
							<td>备注</td>
						</tr>
						<?php if ($orderMaterialArr['fabric']) {?>
						<tr>
							<td rowspan="<?php echo count($orderMaterialArr['fabric'])?>">面料</td>
							<td>{$orderMaterialArr['fabric'][0]['mInfo']['name']}/{$orderMaterialArr['fabric'][0]['mInfo']['model']}</td>
							<td>{$orderMaterialArr['fabric'][0]['mInfo']['color']}/{$orderMaterialArr['fabric'][0]['mInfo']['colornum']}</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
						</tr>
						<?php }?>
						<?php foreach ($orderMaterialArr['fabric'] as $k => $v) {if($k==0)continue;?>
						<tr>
							<td>{$orderMaterialArr['fabric'][$k]['mInfo']['name']}/{$orderMaterialArr['fabric'][$k]['mInfo']['model']}</td>
							<td>{$orderMaterialArr['fabric'][$k]['mInfo']['color']}/{$orderMaterialArr['fabric'][$k]['mInfo']['colornum']}</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
						</tr>
						<?php }?>
						<?php if ($orderMaterialArr['lining']) {?>
						<tr>
							<td rowspan="<?php echo count($orderMaterialArr['fabric']);?>">里料</td>
							<td><?php echo $orderMaterialArr['lining'][0]['mInfo']['name'];?>/<?php echo $orderMaterialArr['lining'][0]['mInfo']['model'];?></td>
							<td><?php echo $orderMaterialArr['lining'][0]['mInfo']['color'];?>/<?php echo $orderMaterialArr['lining'][0]['mInfo']['colornum'];?></td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
						</tr>
						<?php }?>
						<?php foreach ($orderMaterialArr['lining'] as $k => $v) {if($k==0)continue;?>
						<tr>
							<td><?php echo $orderMaterialArr['lining'][$k]['mInfo']['name'];?>/<?php echo $orderMaterialArr['lining'][$k]['mInfo']['model'];?></td>
							<td><?php echo $orderMaterialArr['lining'][$k]['mInfo']['color'];?>/<?php echo $orderMaterialArr['lining'][$k]['mInfo']['colornum'];?></td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
						</tr>
						<?php }?>
						<?php if ($orderMaterialArr['accessories']) {?>
						<tr>
							<td rowspan="<?php echo count($orderMaterialArr['accessories']);?>">辅料</td>
							<td><?php echo $orderMaterialArr['accessories'][0]['mInfo']['name'];?>/<?php echo $orderMaterialArr['accessories'][0]['mInfo']['model'];?></td>
							<td><?php echo $orderMaterialArr['accessories'][0]['mInfo']['color'];?>/<?php echo $orderMaterialArr['accessories'][0]['mInfo']['colornum'];?></td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
						</tr>
						<?php }?>
						<?php foreach ($orderMaterialArr['accessories'] as $k => $v) {if($k==0)continue;?>
						<tr>
							<td><?php echo $orderMaterialArr['accessories'][$k]['mInfo']['name'];?>/<?php echo $orderMaterialArr['accessories'][$k]['mInfo']['model'];?></td>
							<td><?php echo $orderMaterialArr['accessories'][$k]['mInfo']['color'];?>/<?php echo $orderMaterialArr['accessories'][$k]['mInfo']['colornum'];?></td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
						</tr>
						<?php }?>
						<tr>
							<td rowspan="2">包装物料</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
							<td>&nbsp;</td>
						</tr>
						<tr>
							<td colspan="5"><p>工艺要求：</p>
							<p><?php echo $sInfo['process'];?></p>
							</td>
						</tr>
						<tr>
							<td colspan="5"><p>裁剪要求：</p>
							<p><?php echo $sInfo['cutting_requirements'];?></p>
							</td>
						</tr>
						<tr>
							<td colspan="5"><p>车间要求：</p>
							<p><?php echo $sInfo['workshop_requirements'];?></p>
							</td>
						</tr>
						<tr>
							<td colspan="5"><p>尾部要求：</p>
							<p><?php echo $sInfo['tail_requirements'];?></p>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</div>
</body>
</html>